package com.mvc.framework.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import javax.validation.constraints.NotNull;

/**
 * Common auditable entity base class
 * 
 * @author snowpbx
 */
@MappedSuperclass
public class CommonAuditableEntity  extends BaseEntity implements Auditable,CommonConstants{
	/**
	 * Business primary key
	 */
	@NotNull
	private Integer objectId;
	@NotNull
	@Column(columnDefinition = "timestamp")
	private Date createdOn;
	
	@Column(columnDefinition = "timestamp")
	private Date updatedOn;
	@NotNull
	private Boolean recStatus;
	@NotNull
	private Integer createdBy;
	
	private Integer updatedBy;

	public Integer getCreatedBy() {
		return createdBy;
	}
	public void setCreatedBy(Integer createdBy) {
		this.createdBy = createdBy;
	}
	public Integer getUpdatedBy() {
		return updatedBy;
	}
	public void setUpdatedBy(Integer updatedBy) {
		this.updatedBy = updatedBy;
	}
	public Date getCreatedOn() {
    	return createdOn;
    }
	public void setCreatedOn(Date createdOn) {
    	this.createdOn = createdOn;
    }
	public Date getUpdatedOn() {
    	return updatedOn;
    }
	public void setUpdatedOn(Date updatedOn) {
    	this.updatedOn = updatedOn;
    }
	public Boolean getRecStatus() {
    	return recStatus;
    }
	public void setRecStatus(Boolean recStatus) {
    	this.recStatus = recStatus;
    }
	public Integer getObjectId() {
    	return objectId;
    }
	public void setObjectId(Integer objectId) {
    	this.objectId = objectId;
    }
	
	@Override
	public String toString() {
	    return String.valueOf(objectId);
	}

}
